```jsx
import * as zagSwitch from "@zag-js/switch"
import { normalizeProps, useMachine } from "@zag-js/solid"
import { createMemo, createUniqueId } from "solid-js"

function Checkbox() {
  const service = useMachine(zagSwitch.machine, { id: "1" })

  const api = createMemo(() => zagSwitch.connect(service, normalizeProps))

  return (
    <label {...api().getRootProps()}>
      <input {...api().getHiddenInputProps()} />
      <span {...api().getControlProps()}>
        <span {...api().getThumbProps()} />
      </span>
      <span {...api().getLabelProps()}>{api().checked ? "On" : "Off"}</span>
    </label>
  )
}
```
